home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright © 1988,1989,1990 by Succinct Systems
-
- 433 Huronview
- Ann Arbor, MI 48103
- (313) 663-4903
-
- File: PixMapFileIO.h
- Model: THINK C 4.0, MPW C 3.0
-
- ABSTRACT:
- PICT file i/o routines, QuickDraw-32 compatible
-
- NOTES:
- saving 32-bit PixMaps requires a lot of temporary heap space for CopyBits
- calls; if your application saves empty (all black) pictures, increase
- its’ partition size!
-
- KNOWN BUGS:
- ---
-
- HISTORY:
- DAS 14-Jul-89 created this file (David A. Surovell)
- DAS 26-Oct-89 added “rect of interest” control
- DAS 21-Apr-90 cleanly separated PICT <--> PixMap and PICT i/o operations
- added MacPaint B&W file reading
- DAS 27-May-90 added new high-level I/O call discipline
- DAS 08-Jun-90 collected file system arguments into single structure argument
- */
-
- #define _H_PixMapFileIO
-
- #include <Color.h>
-
-
- #define PICTIO_headersize 512L /* PICT file header byte count */
-
- #define PAINTIO_headersize 512L /* standard for a MacPaint image */
- #define PAINTIO_rowbytes 72 /* " " " */
- #define PAINTIO_width 576L /* " " " */
- #define PAINTIO_height 720L /* " " " */
- #define PAINTIO_blocksize 1024L
-
- typedef struct
- {
- long dirID;
- short volumeID;
- short fileRefNum;
- char fileName[256];
- } FSInfoRec;
-
- typedef struct
- {
- OSType fType; /* 4 bytes */
- short hdrID; /* 2 bytes */
- short version; /* 2 bytes */
- } MacDrawFHeader;
-
-
- OSErr Open_pixel_file(
- PixMapHandle thePixels,
- Point *pmBounds,
- FSInfoRec *fileSysData );
-
- OSErr Read_pixel_file(
- PixMapHandle thePixels,
- Point *pmBounds,
- FSInfoRec *fileSysData );
-
-
- OSErr Save_pixel_file(
- PixMapHandle thePixels,
- Rect *rectOfInterest,
- FSInfoRec *fileSysData );
-
- OSErr Write_pixel_file(
- PixMapHandle thePixels,
- Rect *rectOfInterest,
- FSInfoRec *fileSysData );
-
- OSErr Save_GDevice_pixels(
- GDHandle targetGD,
- Rect *rectOfInterest,
- FSInfoRec *fileSysData );
-
- OSErr Read_pict_file(
- PicHandle *thePictHdl,
- FSInfoRec *fileSysData );
-
- OSErr Write_pict_file(
- PicHandle thePictHdl,
- FSInfoRec *fileSysData );
-
- OSErr Read_paint_file(
- BitMap *theBits,
- FSInfoRec *fileSysData );
-
- PicHandle PixMap_CreatePict(
- PixMapHandle thePixels,
- Rect *rectOfInterest );
-
- void FSInfo_Init(
- FSInfoRec *fileSysData );
-
- Boolean FSInfo_Valid(
- FSInfoRec *fileSysData );
-